import request from '@/utils/request'

// 假设有一个 getList 接口
export function getList(params: any) {
  return request({
    url: '/list', // 会自动拼接成 http://192.168.60.13:30000/docs/list
    method: 'get',
    params,
  })
}

export const test = (data: any) => request.get('/get_server_args', { params: data })

export const onSendChatAPI = (data: any) => {
  return request.post(
    '/v1/chat/completions',
    {
      ...data,
      stream: true,
    },
    {
      responseType: 'text',
      transformResponse: [(data: any) => data],
      headers: {
        'Content-Type': 'application/json',
        Accept: 'text/event-stream',
      },
    },
  )
}
